local off,res,range = Vector3.new(0,10,40),.1,10 local wm = Instance.new("WorldModel",script) function trunc(n,d) return math.round(n*d)/d end function createPart(pos,re) local p = Instance.new("Part") p.Size = Vector3.one/(1/(re or res)) p.Anchored = true p.Position = off+pos return p end local parts = {} function rend() for i,v in parts do v.Parent = wm end table.clear(parts) end function draw(func) for x=-range,range,res do for y=-range,range,res do for z=-range,range,res do local pos = Vector3.new(x,y,z) if func(pos) then table.insert(parts,createPart(pos)) end end end end rend() end function reset() wm:ClearAllChildren() -- axees for y=-range*1.5,range*1.5,.05 do local p = createPart(Vector3.new(0,y,0),.05) p.Color = Color3.fromRGB(255,0,0) table.insert(parts,p) end for x=-range*1.5,range*1.5,.05 do local p = createPart(Vector3.new(x,0,0),.05) p.Color = Color3.fromRGB(0,0,255) table.insert(parts,p) end for z=-range*1.5,range*1.5,.05 do local p = createPart(Vector3.new(0,0,z),.05) p.Color = Color3.fromRGB(0,255,0) table.insert(parts,p) end rend() -- end owner.Chatted:Connect(function(w) local s = w:split(" ") if s[1]=="/e" or s[1]=="/emote" then table.remove(s,1) end if s[1]:sub(1,2)~="f/" then return end if s[1]=="f/reset" then reset() elseif s[1]=="f/graph" then local ff,err = loadstring("local x,y,z=(...).X,(...).Y,(...).Z;return "..table.concat(s,' ',2)) if ff==nil then return print('err',err) end draw(ff) elseif s[1]=="f/equal" then local ff,err = loadstring("local x,y,z=(...).X,(...).Y,(...).Z;return y == ("..table.concat(s,' ',2)..")") if ff==nil then return print('err',err) end draw(ff) elseif s[1]:sub(1,6)=="f/set/" then if s[1]:sub(7)=="res" then local n = tonumber(s[2]) if n then res=n;print('set res') else print('failed tonumber') end elseif s[1]:sub(7)=="range" then local n = tonumber(s[2]) if n then range=n;print('set range') else print('failed tonumber') end end end end)